﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GreatB2C.Config.SiteInfo
{
    public class RSSConfig
    {
        #region RSS/WAP配置
        /// <summary>
        /// 是否启用RSS功能
        /// </summary>
        public static string RssEnable
        {
            get
            {
                return BaseConfig.GetConfigValue( BaseConfig.eConfigs.RSS , "RssEnable" );
            }
            set
            {
                BaseConfig.SetConfigValue( BaseConfig.eConfigs.RSS , "RssEnable" , value );
            }
        }

        /// <summary>
        /// 是否启用WAP功能
        /// </summary>
        public static string WapEnable
        {
            get
            {
                return BaseConfig.GetConfigValue( BaseConfig.eConfigs.RSS , "WapEnable" );
            }
            set
            {
                BaseConfig.SetConfigValue( BaseConfig.eConfigs.RSS , "WapEnable" , value );
            }
        }

        /// <summary>
        /// 是否开启WAP单独域名
        /// </summary>
        public static string WapSiteStatus
        {
            get
            {
                return BaseConfig.GetConfigValue( BaseConfig.eConfigs.RSS , "WapSiteStatus" );
            }
            set
            {
                BaseConfig.SetConfigValue( BaseConfig.eConfigs.RSS , "WapSiteStatus" , value );
            }
        }

        /// <summary>
        /// WAP域名
        /// </summary>
        public static string WapSiteUrl
        {
            get
            {
                return BaseConfig.GetConfigValue( BaseConfig.eConfigs.RSS , "WapSiteUrl" );
            }
            set
            {
                BaseConfig.SetConfigValue( BaseConfig.eConfigs.RSS , "WapSiteUrl" , value );
            }
        }

        /// <summary>
        /// 生成WAP图片的大小（单位px）
        /// </summary>
        public static string ImageHeight
        {
            get
            {
                return BaseConfig.GetConfigValue( BaseConfig.eConfigs.RSS , "ImageHeight" );
            }
            set
            {
                BaseConfig.SetConfigValue( BaseConfig.eConfigs.RSS , "ImageHeight" , value );
            }
        }
        public static string ImageWidth
        {
            get
            {
                return BaseConfig.GetConfigValue( BaseConfig.eConfigs.RSS , "ImageWidth" );
            }
            set
            {
                BaseConfig.SetConfigValue( BaseConfig.eConfigs.RSS , "ImageWidth" , value );
            }
        }

        /// <summary>
        /// 生成WAP图片的方式
        /// </summary>
        public static string ThumbsMode
        {
            get
            {
                return BaseConfig.GetConfigValue( BaseConfig.eConfigs.RSS , "ThumbsMode" );
            }
            set
            {
                BaseConfig.SetConfigValue( BaseConfig.eConfigs.RSS , "ThumbsMode" , value );
            }
        }

        public static bool Config( string RssEnable , string WapEnable , string WapSiteStatus , string WapSiteUrl
            , string ImageHeight , string ImageWidth , string ThumbsMode )
        {
            Dictionary<string , string> dicts = new Dictionary<string , string>( );

            dicts.Add( "RssEnable" , RssEnable );
            dicts.Add( "WapEnable" , WapEnable );
            dicts.Add( "WapSiteStatus" , WapSiteStatus );
            dicts.Add( "WapSiteUrl" , WapSiteUrl );
            dicts.Add( "ImageHeight" , ImageHeight );
            dicts.Add( "ImageWidth" , ImageWidth );
            dicts.Add( "ThumbsMode" , ThumbsMode );

            return BaseConfig.SetConfigForBatch( BaseConfig.eConfigs.RSS , dicts );
        }
        #endregion
    }
}
